package com.system.common.constant;

/**
 *  1 菜单，2 内部页面， 3 内部接口， 4 外部页面，5 外部接口
 */
public enum  PurTypeEnum {
    API(6,"纯接口"),
    OUT_SUFFIX_API(5,"外部接口"),
    OUT_PREFIX_API(4,"外部页面"),
    IN_SUFFIX_API(3,"内部接口"),
    IN_PREFIX_API(2,"内部页面"),
    MENU_URL(1,"菜单链接")
    ;
    private int code;
    private String name;

    PurTypeEnum(int code, String name){
        this.code = code;
        this.name = name;
    }

    public static PurTypeEnum getType(int code){
        PurTypeEnum[] typeArr = PurTypeEnum.values();
        for(int i=0;i<typeArr.length;i++){
            PurTypeEnum type = typeArr[i];
            if(type.getCode()==code){
                return type;
            }
        }
        return null;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }
}
